package com.sgb.kjwl.view.ui.adapter;

import android.annotation.SuppressLint;
import android.content.Context;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.user.MaterChooseEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

public class MatterChooseAdapter5 extends BaseRecycleAdapter<MaterChooseEntity.TypeBean> {

    public MatterChooseAdapter5(Context context, List<MaterChooseEntity.TypeBean> datas) {
        super(context, R.layout.item_dict5, datas);
    }

    @SuppressLint("SetTextI18n")
    @Override
    public void convert(ItemViewHolder holder, final MaterChooseEntity.TypeBean entity) {
        TextView nameView = holder.getItem().findViewById(R.id.name_view);
        nameView.setText(entity.getCname());
        RelativeLayout rootLayout = holder.getItem().findViewById(R.id.root_layout);
        if (entity.isChecked()) {
            nameView.setSelected(true);
            rootLayout.setSelected(true);
        } else {
            nameView.setSelected(false);
            rootLayout.setSelected(false);
        }
    }

    public void setStringName(int type) {

    }
}
